Add waypoint read support for Wintec Tes.
authorrobertl <robertl>
Mon, 1 Mar 2010 04:19:40 +0000 (04:19 +0000)
committerrobertl <robertl>
Mon, 1 Mar 2010 04:19:40 +0000 (04:19 +0000)
reference/track/wintec_tes~gpx.gpx
wintec_tes.c

index f967fa69470e367ef6245cf57edef137d121b58b..d12cd4ff9aa1331b3c6d88fdd72097c4f8fd6fe6 100644 (file)
@@ -7,6 +7,34 @@
   xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
 <time>1970-01-01T00:00:00Z</time>
 <bounds minlat="53.114860800" minlon="8.913261600" maxlat="53.122966400" maxlon="8.943510400"/>
+<wpt lat="53.122505600" lon="8.917130400">
+  <ele>-2.000000</ele>
+  <time>2009-12-25T13:53:00Z</time>
+  <name>WPT001</name>
+  <cmt>WPT001</cmt>
+  <desc>WPT001</desc>
+</wpt>
+<wpt lat="53.121904000" lon="8.918889600">
+  <ele>-1.000000</ele>
+  <time>2009-12-25T13:54:48Z</time>
+  <name>WPT002</name>
+  <cmt>WPT002</cmt>
+  <desc>WPT002</desc>
+</wpt>
+<wpt lat="53.114876800" lon="8.943505600">
+  <ele>0.000000</ele>
+  <time>2009-12-25T14:14:59Z</time>
+  <name>WPT003</name>
+  <cmt>WPT003</cmt>
+  <desc>WPT003</desc>
+</wpt>
+<wpt lat="53.122966400" lon="8.916116800">
+  <ele>0.000000</ele>
+  <time>2009-12-25T14:37:19Z</time>
+  <name>WPT004</name>
+  <cmt>WPT004</cmt>
+  <desc>WPT004</desc>
+</wpt>
 <trk>
 <trkseg>
 <trkpt lat="53.122908800" lon="8.917149600">
index 15c8be55224c58004a73f78296e38b6cb5cff62b..f5d76f06cdb6afc463716c50562d19d83aaf0153 100644 (file)
@@ -75,6 +75,20 @@ wintec_tes_read(void)
                // The unit of altitude isn't clear and we have a lot of
                // samples with wildly negative values, so ignore those for now.
                wpt->altitude = alt;
+                
+                // The description given to us says this is a bitmask with
+                //  0x01 "split mark" (not at all clear what that is)
+                //  0x02 interest point
+                //  0x04 track point
+                //  But of the files we've seen, none have had > 1 bit set
+                //  and none have had 0x04 set.
+                //  Wintec's software puts a waypoint in the track, so we
+                //  mock that.
+                if (flags &  0x02) {
+                  waypoint *temp = waypt_dupe(wpt);
+                  waypt_add(temp);
+                }
+
                track_add_wpt(trk, wpt);
        }
 }
@@ -87,8 +101,8 @@ arglist_t wintec_tes_args[] = {
 ff_vecs_t wintec_tes_vecs = {
        ff_type_file,
        { 
-               ff_cap_none                     /* waypoints */, 
-               ff_cap_read                     /* tracks */, 
+               ff_cap_read                     /* waypoints */,
+               ff_cap_read                     /* tracks */,
                ff_cap_none                     /* routes */
        },
        wintec_tes_rd_init,